<template>
	<view class="goodItem">
		<view class="goodsBox flex align-center" @click="todetail">
			<image class="goodImg"  mode="aspectFill" lazy-load :src="goods.cover_pic"></image>
			<view class="goodText flex flex-direction justify-between">
				<view class="goodsName nodetext2">{{goods.name}}</view>
				<view class="flex">
					<view class="couponBox">抵券{{goods.forehead_integral}}</view>
				</view>
				<view class="flex justify-between align-center">
					<view class="flex align-center">
						<view style="color: #ff5a5a;">
							<text style="font-size: 24upx;">￥</text>
							<text style="font-size: 32upx;font-weight: bold;">{{(goods.price-goods.forehead_integral).toFixed(2)-0}}</text>
						</view>
						<!-- <view style="color:#aaa;text-decoration: line-through;margin-left: 20upx;">
							<text style="font-size: 20upx;">￥</text>
							<text style="font-size: 24upx;">{{goods.price-0}}</text>
						</view> -->
					</view>
					
					<view class="buyBtn" style="background: #ccc;" v-if="state == 0 || goods.goods_stock == 0">已售完</view>
					<view class="buyBtn" v-else>立即预购</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			goods:{},
			state:''
		},
		data() {
			return {

			}
		},
		methods: {
			todetail(){
				uni.navigateTo({
					url:'/plugins/jimai/goods?type=2&goods_id='+this.goods.id
				})
			}
		}
	}
</script>

<style scoped>
	.buyBtn{
		width: 160upx;
		line-height: 50upx;
		text-align: center;
		color: #fff;
		font-size: 26upx;
		border-radius: 10upx;
		background:#3c392a;
	}
	.couponBox{
		font-size: 24upx;
		line-height: 40upx;
		padding: 0 10upx;
		color:#ff5a5a;
		border: 1px solid #ff5a5a;
		border-radius: 6upx;
	}
	.goodsName{
		font-size: 28upx;
		line-height: 38upx;
		height: 80upx;
	}
	.goodText{
		width:470upx;
		margin-left: 20upx;
		height: 190upx;
	}
	.goodImg{
		width: 180upx;
		height: 180upx;
		border-radius: 10upx;
	}
	.goodsBox{
		width: 710upx;
		margin-bottom: 20upx;
		margin-left: 20upx;
		background: #fff;
		border-radius: 20upx;
		padding: 20upx;
	}
	.goodItem{
		width: 100%;
		margin-top: 20upx;
	}
</style>